

<!DOCTYPE html>
<html lang="zh-CN">

<head><meta name="generator" content="Hexo 3.9.0">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>使用 Navigation + Dynamic Feature Module 实现模块化 - 杨云召 | 博客</title>
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate">

  
  
  <meta name="description" content="使用 Navigation + Dynamic Fea..."> 
  
  <meta name="author" content="杨云召（Flywith24）"> 

  
    <link rel="icon" href="/images/icons/favicon-16x16.png" type="image/png" sizes="16x16">
  
  
    <link rel="icon" href="/images/icons/favicon-32x32.png" type="image/png" sizes="32x32">
  
  
    <link rel="apple-touch-icon" href="/images/icons/apple-touch-icon.png" sizes="180x180">
  
  
    <meta rel="mask-icon" href="/images/icons/stun-logo.svg" color="#333333">
  
  
    <meta rel="msapplication-TileImage" content="/images/icons/favicon-144x144.png">
    <meta rel="msapplication-TileColor" content="#000000">
  

  <link rel="stylesheet" href="/css/style.css">

  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_hhodbqn7tit.css">
  

  
  
  <link rel="stylesheet" href="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.css">
  

  
  
  <link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/xcode.min.css">
  

  <script>
    var CONFIG = window.CONFIG || {};
    var ZHAOO = window.ZHAOO || {};
    CONFIG = {
      isHome: false,
      fancybox: true,
      pjax: false,
      lazyload: {
        enable: true,
        loadingImage: '/images/theme/loading.gif',
      },
      donate: {
        enable: true,
        alipay: 'https://gitee.com/flywith24/Album/raw/master/img/20201015113301.jpg',
        wechat: 'https://gitee.com/flywith24/Album/raw/master/img/20201015112814.png'
      },
      motto: {
        api: '',
        default: '不人云亦云，只求接近真相.'
      },
      galleries: {
        enable: true
      },
      fab: {
        enable: true,
        alwaysShow: false
      },
      carrier: {
        enable: true
      },
      daovoice: {
        enable: true
      }
    }
  </script>

  

  
</head></html>
<body class="lock-screen">
  <div class="loading"></div>
  


<nav class="navbar">
  <div class="left"></div>
  <div class="center">使用 Navigation + Dynamic Feature Module 实现模块化</div>
  <div class="right">
    <i class="iconfont iconmenu j-navbar-menu"></i>
  </div>
</nav>

  <nav class="menu">
  <div class="menu-wrap">
    <div class="menu-close">
      <i class="iconfont iconbaseline-close-px"></i>
    </div>
    <ul class="menu-content">
      
      
      
      
      <li class="menu-item"><a href="/ " class="underline"> 首页</a></li>
      
      
      
      
      <li class="menu-item"><a href="/archives " class="underline"> 归档</a></li>
      
      
      
      
      <li class="menu-item"><a href="/tags " class="underline"> 标签</a></li>
      
      
      
      
      <li class="menu-item"><a href="/categories " class="underline"> 分类</a></li>
      
      
      
      
      <li class="menu-item"><a href="/about " class="underline"> 关于</a></li>
      
    </ul>
    <div class="menu-copyright"><p>Copyright© 2017 - 2020 ❤️ Flywith24</p></div>
  </div>
</nav>
  <main id="main">
  <div class="container" id="container">
    <article class="article">
  <div class="wrap">
    <section class="head">
  <img   class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20201015104605.png" src=""  draggable="false">
  <div class="head-mask">
    <h1 class="head-title">使用 Navigation + Dynamic Feature Module 实现模块化</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>五月 20, 2020</span
        class="post-info-item">
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>2331</span>
    </div>
  </div>
</section>
    <section class="main">
      <section class="content">
        <p><code>androidx navigation 2.3.0</code> 加入了对 <code>dynamic feature module</code> 的导航支持，因此我们利用这个来分离出多个功能 module 来实现模块化</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520170621.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="navigation 2.3.0 更新"></p>
<h2 id="国内基本不用的-dynamic-feature-module"><a href="#国内基本不用的-dynamic-feature-module" class="headerlink" title="国内基本不用的 dynamic feature module"></a>国内基本不用的 dynamic feature module</h2><p><a href="https://developer.android.com/guide/app-bundle" target="_blank" rel="noopener">Android App Bundle</a> 是官方 18 年推出的动态发布方案，类似国内各种插件化方案。不过它需要 Google Play Store 支持，这导致在国内无法使用</p>
<p>借着 navigation 组件支持 <code>dynamic feature module</code> 间导航的契机，我们可以使用 <code>dynamic feature module</code> 来拆分功能模块以实现模块化</p>
<p>传统的拆分方案大概是这样，feature module 之间相互隔离，app module 依赖各个 feature module 间接依赖 base 库，公共库</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520165717.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="传统架构"></p>
<p>而使用 <code>dynamic feature module</code> ，其结构是这样的</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520172609.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="dynamic feature 架构"></p>
<p><code>dynamic feature module</code> 也可以按需安装，也就是说，它们可能不包含在用户最初下载的 APK 中，而是在运行时安装。而我们可以直接将它们包含到 APK 中</p>
<h2 id="使用-dynamic-feature-module"><a href="#使用-dynamic-feature-module" class="headerlink" title="使用 dynamic feature module"></a>使用 dynamic feature module</h2><p>首先我们在 base lib 中引入依赖</p>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs groovy">dependencies &#123;<br>    <span class="hljs-keyword">def</span> nav_version = <span class="hljs-string">"2.3.0-alpha06"</span><br><br>    api <span class="hljs-string">"androidx.navigation:navigation-fragment-ktx:$nav_version"</span><br>    api <span class="hljs-string">"androidx.navigation:navigation-ui-ktx:$nav_version"</span><br>    api <span class="hljs-string">"androidx.navigation:navigation-dynamic-features-fragment:$nav_version"</span><br>&#125;<br></code></pre></td></tr></table></figure>

<p>我们在 app module 中的 res/navigation 目录下创建 main_nav.xml</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520173227.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="main_nav.xml"></p>
<p>接着我们在 activity_main 中设置默认的 host</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520173336.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="默认 host"></p>
<blockquote>
<p>这里不同于正常 navigation 的用法，没有使用 NavHostFragment，而是使用 DynamicNavHostFragment</p>
</blockquote>
<h3 id="直接跳转-fragment"><a href="#直接跳转-fragment" class="headerlink" title="直接跳转 fragment"></a>直接跳转 fragment</h3><p>我们创建 dynamic feature module ，取名为 feature1</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520174302.gif" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="创建 dynamic feature module"></p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520174505.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="包名前部分需保证与 applicationId 相同"></p>
<blockquote>
<p>这里 <code>dynamic feature module</code> 的包名前部分要和 applicationId 即 app module 包名相同，否则后续的 include 操作会有问题</p>
</blockquote>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520174757.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="选择加载模式"></p>
<p>这里我们选择在安装时集成该 module</p>
<p>接着我们在该 module 下创建一个 fragment 取名为 <code>Feature1OneFragment</code></p>
<p>之后我们直接在 main_nav.xml 中引入 该 fragment 并加入 action</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520175351.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="直接引入 fragment"></p>
<p>接着我们就可以在 app 下的 MainFragment 打开 Feature1OneFragment</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520175841.gif" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="启动 fragment"></p>
<blockquote>
<p>我的 demo 中 feature2 是直接引入 fragment，因此跳转的是 Feature2OneFragment</p>
</blockquote>
<h3 id="直接跳转-activity"><a href="#直接跳转-activity" class="headerlink" title="直接跳转 activity"></a>直接跳转 activity</h3><p>在 feature1 中创建 activity (demo 中为 feature2)</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520180201.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="跳转 activity"></p>
<p>同样需要指定 moduleName</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520180434.gif" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="启动activity"></p>
<h3 id="使用-dynamic-feature-module-内部的-graph"><a href="#使用-dynamic-feature-module-内部的-graph" class="headerlink" title="使用 dynamic feature module 内部的 graph"></a>使用 dynamic feature module 内部的 graph</h3><p>我们可以为 dynamic feature module 单独配置 navigation graph，这样就可以处理 dynamic feature module 内部的跳转了</p>
<p>在 feature1 中创建 feature1_nav.xml ，其中 startDestination 为 Feature1OneFragment</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520181021.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="feature1_nav.xml"></p>
<p>在 main_nav.xml 我们需要使用另外一种方式来使用该 graph</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520181145.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="include-dynamic"></p>
<p>我们使用了一个新的标签 <code>include-dynamic</code>，同时我们看到了几个没用过的属性</p>
<ul>
<li><code>graphPackage</code> 为 <code>dynamic feature module</code> 的包名</li>
<li><code>graphResName</code> 为 <code>dynamic feature module</code> 内部 graph 的名字</li>
<li><code>moduleName</code> 为 module 名</li>
</ul>
<blockquote>
<p>注意：这里的 graphPackage 可以省略</p>
<ol>
<li>如果 module 的包名没用按照前文的格式配置会导致无法找到 graphId 的异常</li>
<li>include-dynamic 标签的 id 要与 <code>feature1_nav.xml</code> navigation 标签下的 id 一致，或者后者不设置 id</li>
</ol>
</blockquote>
<p>这样从 app module 导航到 feature1 的 startDestination 后便可使用其内部的逻辑进行后续的导航了</p>
<p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520182339.gif" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="include 跳转"></p>
<h2 id="feature-module-间跳转"><a href="#feature-module-间跳转" class="headerlink" title="feature module 间跳转"></a>feature module 间跳转</h2><p><img class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20200520182529.png" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt="暂不支持 deep link"></p>
<p>Navigation 组件暂不支持 Dynamic include graph 的 deep link</p>
<p>因此我目前也没有找到特别优雅的方式，已知的方案如下</p>
<ul>
<li>反射</li>
<li>使用 <a href="https://developer.android.com/reference/java/util/ServiceLoader" target="_blank" rel="noopener">ServiceLoader</a></li>
<li>使用依赖注入</li>
</ul>
<p><a href="https://github.com/Flywith24/DynamicFeatureDemo" target="_blank" rel="noopener">demo</a></p>
<h2 id="关于我"><a href="#关于我" class="headerlink" title="关于我"></a>关于我</h2><p>我是 <a href="https://flywith24.gitee.io/">Flywith24</a>，我的博客内容已经分类整理 <a href="https://github.com/Flywith24/BlogList" target="_blank" rel="noopener">在这里</a>，点击右上角的 Watch 可以及时获取我的文章更新哦 😉</p>
<ul>
<li><p><a href="https://juejin.im/user/57c7f6870a2b58006b1cfd6c" target="_blank" rel="noopener">掘金</a></p>
</li>
<li><p><a href="https://xiaozhuanlan.com/detail" target="_blank" rel="noopener">小专栏</a></p>
</li>
<li><p><a href="https://github.com/Flywith24" target="_blank" rel="noopener">Github</a></p>
</li>
</ul>
<p><img class="lazyload" data-original="https://user-gold-cdn.xitu.io/2020/6/26/172ee567fb4fbf7e?w=1954&h=624&f=jpeg&s=115362" src="/2020/05/20/Tips-Navagion+DynamicFeatureModule/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" alt></p>
      </section>
      <section class="extra">
        
        <ul class="copyright">
  
  <li><strong>本文作者：</strong>杨云召（Flywith24）</li>
  <li><strong>本文链接：</strong><a href="https://flywith24.gitee.io/2020/05/20/Tips-Navagion+DynamicFeatureModule/index.html">https://flywith24.gitee.io/2020/05/20/Tips-Navagion+DynamicFeatureModule/index.html</a></li>
  <li><strong>版权声明：</strong>本博客所有文章均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"
      rel="external nofollow" target="_blank"> BY-NC-SA </a>许可协议，转载请注明出处！</li>
  
</ul>
        
        
        <section class="donate">
  <div class="qrcode">
    <img   class="lazyload" data-original="https://gitee.com/flywith24/Album/raw/master/img/20201015113301.jpg" src="" >
  </div>
  <div class="icon">
    <a href="javascript:;" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
        
        
  <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Tips/">Tips</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/奇技淫巧/">奇技淫巧</a></li></ul>

        
<nav class="nav">
  
    <a href="/2020/07/01/Tips-ProcessLifecycle/"><i class="iconfont iconleft"></i>使用 ProcessLifecycle 优雅地监听应用前后台切换</a>
  
  
    <a href="/2020/05/18/Tips-Coil/">新的图片加载库？基于Kotlin协程的图片加载库——Coil<i class="iconfont iconright"></i></a>
  
</nav>

      </section>
      
      <section class="comments">
  
  <div class="btn" id="comments-btn">查看评论</div>
  
  
<div id="valine"></div>
<script defer src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script>
  window.onload = function () {
    var loadValine = function () {
      new Valine({
        el: '#valine',
        app_id: "SHA3gzCcxFlqaPcGRnX4UgET-gzGzoHsz",
        app_key: "OYo7ITS4AzTvBUvb1yIY8oaf",
        placeholder: "期待你的留言",
        avatar: "mp",
        pageSize: "10",
        lang: "zh-CN",
      });
    }
    if ( true ) {
      $("#comments-btn").on("click", function () {
        $(this).hide();
        loadValine();
      });
    } else {
      loadValine();
    }
  };
</script>

</section>
      
    </section>
  </div>
</article>
  </div>
</main>
  <footer class="footer">
  <div class="footer-social">
    
    
    
    
    
    <a href="tencent://message/?Menu=yes&uin=1032367864 " target="_blank" onMouseOver="this.style.color= '#12B7F5'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconQQ "></i>
    </a>
    
    
    
    
    
    <a href="javascript:; " target="_blank" onMouseOver="this.style.color= '#8bc34a'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconwechat-fill "></i>
    </a>
    
    
    
    
    
    <a href="https://flywith24.gitee.io/about/ " target="_blank" onMouseOver="this.style.color= '#d32f2f'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconheart "></i>
    </a>
    
    
    
    
    
    <a href="https://github.com/Flywith24 " target="_blank" onMouseOver="this.style.color= '#24292E'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  icongithub-fill "></i>
    </a>
    
    
    
    
    
    <a href="mailto:youngyunzhao@163.com " target="_blank" onMouseOver="this.style.color='#FFBE5B'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconmail"></i>
    </a>
    
  </div>
  <div class="footer-copyright"><p>Copyright© 2017 - 2020 ❤️ Flywith24</p></div>
</footer>
  
      <div class="fab fab-plus">
    <i class="iconfont iconplus"></i>
  </div>
  
  <div class="fab fab-daovoice">
    <i class="iconfont iconcomment"></i>
  </div>
  
  <div class="fab fab-up">
    <i class="iconfont iconcaret-up"></i>
  </div>
  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"left","width":150,"height":300},"mobile":{"show":"tfalse"},"log":false});</script></body>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>




<script src="https://cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>




<script src="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.js"></script>




<script src="/js/utils.js"></script>
<script src="/js/modules.js"></script>
<script src="/js/zui.js"></script>
<script src="/js/script.js"></script>




<script>
  (function (i, s, o, g, r, a, m) {
    i["DaoVoiceObject"] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date();
    a = s.createElement(o), m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    a.charset = "utf-8";
    m.parentNode.insertBefore(a, m)
  })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') +
    "//widget.daovoice.io/widget/0f81ff2f.js", "daovoice")
  daovoice('init', {
    app_id: "7785620b"
  }, {
    launcher: {
      disableLauncherIcon: true,
    },
  });
  daovoice('update');
</script>



<script>
  (function () {
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
      bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    } else {
      bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
  })();
</script>


<script>
  var _hmt = _hmt || [];
  (function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?4c204d8bc027a0455b5fc642ac334ca8";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>










</html>